SET(WIN32 1)
SET(WINCE 1)

# Grab the standard windows settings
INCLUDE(Platform/Windows)

# Generate the hex value of our wince version
IF(CMAKE_SYSTEM_VERSION MATCHES "[0-9]+\\.[0-9][0-9]")
	STRING(REGEX REPLACE "([0-9]*)\\.([0-9]*)" "0x\\1\\2" CMAKE_SYSTEM_VERSION_HEX  "${CMAKE_SYSTEM_VERSION}" )
ELSE(CMAKE_SYSTEM_VERSION MATCHES "[0-9]+\\.[0-9][0-9]")
	MESSAGE(SEND_ERROR "Please set a CMAKE_SYSTEM_VERSION that matches: [0-9]+'.'[0-9][0-9]" )
	SET(CMAKE_SYSTEM_VERSION_HEX "0x200")
ENDIF(CMAKE_SYSTEM_VERSION MATCHES "[0-9]+\\.[0-9][0-9]")

# Setup the standard compile flags
ADD_DEFINITIONS(
	-D_WIN32_WCE=${CMAKE_SYSTEM_VERSION_HEX}
	-DUNDER_CE=${CMAKE_SYSTEM_VERSION_HEX}
	-D${CMAKE_CL_MACHINE_TYPE}
	-D_${CMAKE_CL_MACHINE_TYPE}_
	-D_M_${CMAKE_CL_MACHINE_TYPE}
	-D_UNICODE
	-DUNICODE
	-D_WINDOWS 
	-DWINCE
	-D${WINCE_PLATFORM_TYPE}
	-D_WINDLL
)
